// This file is used to store and manage the mock data for projects.
// All data generation logic is isolated here for better maintainability and reusability.

// Function to generate mock project data
const generateMockProjects = () => {
  const allProjects = {};
  // List of project names for generating mock data
  const projectNames = ['项目1', '项目B', '项目C', '项目D', '项目E', '项目F', '项目G', '项目H', '项目I', '项目J'];
  
  // Loop through each project name to create a project object
  projectNames.forEach((name, index) => {
    allProjects[name] = {
      // Core contributors with a unique ID, name, avatar URL, and summary
      core: [
        { id: `${index}-core-1`, name: `Core Contributor ${index + 1}-1`, avatarUrl: `https://placehold.co/150x150/0f8455/ffffff?text=C${index+1}`, summary: `${name}核心维护者` },
        { id: `${index}-core-2`, name: `Core Contributor ${index + 1}-2`, avatarUrl: `https://placehold.co/150x150/017373/ffffff?text=C${index+1}`, summary: `${name}主要架构师` }
      ],
      // Active contributors
      active: [
        { id: `${index}-active-1`, name: `Active Contributor ${index + 1}-1`, avatarUrl: `https://placehold.co/150x150/a9a300/ffffff?text=A${index+1}`, summary: `修复了${Math.floor(Math.random() * 20) + 1}个关键Bug` },
        { id: `${index}-active-2`, name: `Active Contributor ${index + 1}-2`, avatarUrl: `https://placehold.co/150x120/ff9933/ffffff?text=A${index+1}`, summary: `撰写了${name}的文档` }
      ],
      // Legacy contributors
      legacy: [
        { id: `${index}-legacy-1`, name: `Legacy Contributor ${index + 1}-1`, avatarUrl: `https://placehold.co/150x150/8a2be2/ffffff?text=L${index+1}`, summary: `${name}的初代开发者` }
      ]
    };
  });
  return allProjects;
};

// Export the generated projects data so it can be imported and used by other components
export const projects = generateMockProjects();
